package com.mega.ebcs.util;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.commons.io.FileUtils;

public class CamelUtils {
	public static boolean isFileUnlocked(File fileName){
		boolean isFileUnlocked = false;
		try {
		    FileUtils.touch(fileName);
		    isFileUnlocked = true;
		} catch (IOException e) {
		    isFileUnlocked = false;		    
		}		
		return isFileUnlocked;
	}
	
	@SuppressWarnings("rawtypes")
	public static void printMap(Map mp) {
	    Iterator it = mp.entrySet().iterator();
	    while (it.hasNext()) {
	       Entry pairs = (Entry)it.next();
	        System.out.println(pairs.getKey() + " = " + pairs.getValue());
	        it.remove(); // avoids a ConcurrentModificationException
	    }
	}	
}
